import { IUser } from './auth.interface';
import { IResponse } from './common.interface';
import { IRoomDevice } from './device.interface';

export interface ICreateRoomParams {
  name: string;
  creator: IUser;
}

export interface ICreateRoomResp extends IResponse {
  data: IRoom;
}

export interface IRoom {
  id: string; // 房间id
  name: string; // 房间名称
  create_time: string; // 创建时间
  creator: IUser; // 创建者
  devids: string[]; // 设备id列表
  status: boolean; // true: 运行; false: 停止
  settings: {
    // 房间局部配置
    illu: number; // 光照临界值
    ac_cp: string[]; // 空调受控周期
    light_cp: string[]; // 灯控受控周期
  };
  count: number
}

export interface IAddDeviceResp extends IResponse {
  data: IRoomDevice;
}

export interface ILog {
  operation: ILogInfo[];
  temperature: ILogInfo[];
}

export interface ILogInfo {
  date: string;
  messages: ILogMessage[];
}

export interface ILogMessage {
  time: string;
  value: string | number;
  color?: IColorType;
}

export type IColorType = 'success' | 'error' | 'warning';
